<template>
  <div class="search">
    <f-form ref="form" :action="api.bfd" :form-key="this.formItem.financeDetailsId" >
      <f-form-item label="对账表ID"  name="financeId"    :value="formItem.financeId" />
      <f-form-item label="订单ID"  name="orderId"    :value="formItem.orderId" />
      <f-form-item label="订单明细ID"  name="orderDetailsId"    :value="formItem.orderDetailsId" />
      <f-form-item label="单号"  name="orderNo"    :value="formItem.orderNo" />
      <f-form-item label="销售日期"  name="saleDate"    :value="formItem.saleDate" />
      <f-form-item label="部门名称"  name="deptName"    :value="formItem.deptName" />
      <f-form-item label="业务员名称"  name="saleManName"    :value="formItem.saleManName" />
      <f-form-item label="供货商名称"  name="supplierName"    :value="formItem.supplierName" />
      <f-form-item label="药品名称"  name="drugsName"    :value="formItem.drugsName" />
      <f-form-item label="规格"  name="drugsSpec"    :value="formItem.drugsSpec" />
      <f-form-item label="数量"  name="saleNum"    :value="formItem.saleNum" />
      <f-form-item label="价格"  name="salePrice"    :value="formItem.salePrice" />
      <f-form-item label="销售金额"  name="saleAmount"    :value="formItem.saleAmount" />
      <f-form-item label="回款金额"  name="returnAmount"    :value="formItem.returnAmount" />
      <f-form-item label="回款日期"  name="returnDate"    :value="formItem.returnDate" />
      <f-form-item label="资保金金额"  name="customBondAmount"    :value="formItem.customBondAmount" />
      <f-form-item label="收款日期"  name="takeDate"    :value="formItem.takeDate" />
      <f-form-item label="资保金退款"  name="returnCustomBond"    :value="formItem.returnCustomBond" />
      <f-form-item label="应结算金额"  name="settleAmount"    :value="formItem.settleAmount" />
      <f-form-item label="已结算金额"  name="yesSettleAmount"    :value="formItem.yesSettleAmount" />
      <f-form-item label="结算日期"  name="settlePayDate"    :value="formItem.settlePayDate" />
      <f-form-item label="未结算金额"  name="noSettleAmount"    :value="formItem.noSettleAmount" />
      <f-form-item label="批号"  name="drugsLotNo"    :value="formItem.drugsLotNo" />
      <f-form-item label="创建时间"  name="createTime"    :value="formItem.createTime" />
      <f-form-item label="更新时间"  name="updateTime"    :value="formItem.updateTime" />
    </f-form>
  </div>
</template>
<script>
  import api from './js/api'
  export default {
    name: 'bfdForm',
    props: {},
    data() {
      return {
        refs:this.$refs,
        api:  Object.assign(api, this.api),
        isAdd: true,//是否是添加模式
        loaded: false,//是否加载完成
        formItem: this.getFormItem()
      }
    },
    methods: {
      getFormItem() {
        return {
          financeDetailsId: '',
          financeId: '',
          orderId: '',
          orderDetailsId: '',
          orderNo: '',
          saleDate: '',
          deptName: '',
          saleManName: '',
          supplierName: '',
          drugsName: '',
          drugsSpec: '',
          saleNum: '',
          salePrice: '',
          saleAmount: '',
          returnAmount: '',
          returnDate: '',
          customBondAmount: '',
          takeDate: '',
          returnCustomBond: '',
          settleAmount: '',
          yesSettleAmount: '',
          settlePayDate: '',
          noSettleAmount: '',
          drugsLotNo: '',
          createTime: '',
          updateTime: ''
        }
      },
      //表单赋值
      setData(data) {
        this.$refs.form.resetFields()
        this.formItem = this.getFormItem()
        if (data && data.financeDetailsId) {
          let params={
              financeDetailsId:data.financeDetailsId
          }
          this.refs['form'].getDetails(params,(data)=>{
             this.formItem=data
             this.loaded = true
          })
          this.isAdd = false
        } else {
          this.loaded = true
        }
      },
      //提交表单
      handleSubmit(callback) {
        this.$refs.form.submit({  }, callback)
      }
    },
    created() {
    },
    components: {}
  }
</script>

<style scoped lang="less" rel="stylesheet/less">

</style>
